<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <f:view locale="#{bundle.locale}">
    <body>

        <ui:composition template="./Base.xhtml">

            <ui:define name="content">
                <div id="TwoContainers" class="container-fluid">
                    <div class="row-fluid">
                        <ui:include src="Menu.xhtml" />
                        <div id="bodyContent" class="span10">
                            <!--Body content-->
                            <h1><h:outputText value="#{msg.LabelPanier}"/></h1>  
                            
                            <h:dataTable value="#{controller_Cart.listItem}" var="line" class="table table-striped">
                                <h:column>
                                    <f:facet  name="header">
                                        <h:outputText value="#{msg.ColoneJaquette}"/>
                                    </f:facet>
                                    <h:graphicImage class="imgCard#{line.prod.type}" value="#{line.prod.pic}"></h:graphicImage>
                                </h:column>
                                <h:column> 
                                    <f:facet  name="header">
                                        <h:outputText value="#{msg.ColonneArticle}"/>
                                    </f:facet>
                                    <h:outputText value="#{line.prod.title}"/>
                                </h:column>
                                <h:column>
                                    <f:facet  name="header">
                                        <h:outputText value="#{msg.ColonneCat}"/>
                                    </f:facet>
                                    <h:outputText value="#{line.type}"/>
                                </h:column>
                                <h:column>
                                    <f:facet  name="header">
                                        <h:outputText value="#{msg.ColonneExemplaire}"/>
                                    </f:facet>
                                    <h:outputText value="#{line.qte}"/>
                                </h:column>
                                <h:column>
                                    <f:facet  name="header">
                                        <h:outputText value="#{msg.ColonnePrixUnitaire}"/>
                                    </f:facet>
                                    <h:outputText value="#{line.prod.getPrice()}"/>
                                </h:column>
                                <h:column>
                                    <f:facet  name="header">
                                        <h:outputText value="#{msg.ColonnePrix}"/>
                                    </f:facet>
                                    <h:outputText value="#{line.cout}"/>
                                </h:column>
                                <h:column>
                                    <f:facet  name="header">
                                        <h:outputText value="-"/>
                                    </f:facet>
                                    <h:form>
                                        <h:commandLink class="redCircle" action="#{controller_Cart.supItem(line)}" ><i class="icon-remove"></i></h:commandLink>
                                    </h:form>
                                </h:column>
                            </h:dataTable>
                       <br/> 
                       <h2><h:outputText value="#{controller_Cart.total}"/></h2>   
                       </div>
                       <br/><br/>
                          <c:choose>
                               <c:when test="${controller_Cart.getNbItem() == 0}">
     
                               </c:when>
                               <c:when test="${empty login.currentUser}">
                                   <div >
                                        <br/>
                                        <a id="ConnexionCart" class="btn btn-primary" ><i class="icon-user"></i><h:outputLabel value="#{msg.BoutonLogin}"/></a>
                                   </div>
                               </c:when>
                               <c:otherwise>
                                   <h:form>  
                                        <div id="BtnConnectOrder">
                                            <br/>
                                            <h:commandButton id="btnCommand" class="btn btn-primary"  action="#{controller_Cart.validCart()}" value="#{msg.Btncommand}" />
                                        </div>
                                   </h:form>
                               </c:otherwise>
                          </c:choose>
                    </div>
                </div>
                
            </ui:define>

        </ui:composition>

    </body>
    </f:view>
</html>
